/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "reporting_periods" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "ReportingPeriods.findAll" , query = "SELECT r FROM ReportingPeriods r" ) ,
    @NamedQuery( name = "ReportingPeriods.findByRefPeriod" , query = "SELECT r FROM ReportingPeriods r WHERE r.refPeriod = :refPeriod" ) ,
    @NamedQuery( name = "ReportingPeriods.findByCurrentPeriod" , query = "SELECT r FROM ReportingPeriods r WHERE r.currentPeriod = :currentPeriod" ) ,
    @NamedQuery( name = "ReportingPeriods.findByPriorPeriod" , query = "SELECT r FROM ReportingPeriods r WHERE r.priorPeriod = :priorPeriod" ) ,
    @NamedQuery( name = "ReportingPeriods.findByCreatedBy" , query = "SELECT r FROM ReportingPeriods r WHERE r.createdBy = :createdBy" ) ,
    @NamedQuery( name = "ReportingPeriods.findByDateCreated" , query = "SELECT r FROM ReportingPeriods r WHERE r.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "ReportingPeriods.findByModifiedBy" , query = "SELECT r FROM ReportingPeriods r WHERE r.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "ReportingPeriods.findByDateModified" , query = "SELECT r FROM ReportingPeriods r WHERE r.dateModified = :dateModified" )
} )
public class ReportingPeriods implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic( optional = false )
    @Column( name = "ref_period" )
    private String refPeriod;
    @Basic( optional = false )
    @Column( name = "current_period" )
    private String currentPeriod;
    @Basic( optional = false )
    @Column( name = "prior_period" )
    private String priorPeriod;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;


    public ReportingPeriods()
    {
    }


    public ReportingPeriods( String refPeriod )
    {
        this.refPeriod = refPeriod;
    }


    public ReportingPeriods( String refPeriod , String currentPeriod , String priorPeriod , String createdBy , Date dateCreated )
    {
        this.refPeriod = refPeriod;
        this.currentPeriod = currentPeriod;
        this.priorPeriod = priorPeriod;
        this.createdBy = createdBy;
        this.dateCreated = dateCreated;
    }


    public String getRefPeriod()
    {
        return refPeriod;
    }


    public void setRefPeriod( String refPeriod )
    {
        this.refPeriod = refPeriod;
    }


    public String getCurrentPeriod()
    {
        return currentPeriod;
    }


    public void setCurrentPeriod( String currentPeriod )
    {
        this.currentPeriod = currentPeriod;
    }


    public String getPriorPeriod()
    {
        return priorPeriod;
    }


    public void setPriorPeriod( String priorPeriod )
    {
        this.priorPeriod = priorPeriod;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( refPeriod != null ? refPeriod.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof ReportingPeriods ) )
        {
            return false;
        }
        ReportingPeriods other = (ReportingPeriods) object;
        if ( ( this.refPeriod == null && other.refPeriod != null ) || ( this.refPeriod != null && !this.refPeriod.equals( other.refPeriod ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.ReportingPeriods[ refPeriod=" + refPeriod + " ]";
    }
    
}
